data("instacart")
instacart=
instacart %>%
select(aisle, product_name, order_hour_of_day,
department, order_dow) %>%
filter(department=="produce") %>%
mutate(aisle= factor(aisle))
Column
Chart A
instacart %>%
count(aisle) %>%
mutate(aisle = fct_reorder(aisle, n)) %>%
plot_ly(x = ~aisle, y = ~n, color = ~aisle, type = "bar")
Column
Chart B
instacart %>%
mutate(aisle= fct_reorder(aisle, order_hour_of_day))%>%
plot_ly(x = ~aisle, y = ~order_hour_of_day, color = ~aisle, type = "box")
Chart C
instacart %>%
group_by(aisle, order_dow) %>%
mutate(mean_order_hour= mean(order_hour_of_day)) %>%
ungroup() %>%
plot_ly(x = ~order_dow, y = ~mean_order_hour, color = ~aisle)%>%
add_lines()